package com.example.pong;

public class Score extends java.util.Observable{

	/*
	 * Model in MVC. MVC are only implemented in the Score functionality
	 */
	
	private static final Score score = new Score();
	private int playerScore;
	private int computerScore;
	
	private Score(){
		playerScore = 0;
		computerScore = 0;
	}
	
	public static Score getInstance(){
		return score;
	}
	
	public void setPlayerScore() {
		playerScore += 1;
		setChanged();
		notifyObservers();
	}

	public void setComputerScore() {
		computerScore += 1;
		setChanged();
		notifyObservers();
	}

	public int getPlayerScore() {
		return playerScore;
	}

	public void setPlayerScore(int playerScore) {
		this.playerScore = playerScore;
	}

	public int getComputerScore() {
		return computerScore;
	}

	public void setComputerScore(int computerScore) {
		this.computerScore = computerScore;
	}
	
	@Override
	public String toString(){
		return "Score";
	}

}
